package com.group2.demo_country_group2;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;

public class MainActivity extends FragmentActivity {
	public FragmentManager fragmentManager;
	int container;
	private ListView lvCountry;
	private CountryAdapter lvAdapter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //slvCountry = findViewById(R.id.)
        lvCountry.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				replaceFragment(new CountryPager());
			}
		});
        		
    }
    public void replaceFragment(Fragment fragment)
	{
		FragmentTransaction transaction = fragmentManager.beginTransaction();
		transaction.replace(container, fragment);
		transaction.commit();
	}
	
}
